package com.fofia.iotweb;

import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;
import org.noear.solon.auth.annotation.AuthPermissions;
import org.noear.solon.core.handle.Context;
import org.noear.solon.core.handle.ModelAndView;

@Controller
public class DemoController {


    @Mapping("/hello")
    public String hello(@Param(defaultValue = "world") String name) {
        return String.format("Hello %s!", name);
    }
    

    @Mapping("/get")
    @AuthPermissions("user.get")
    public String get(){
        Context.current().cookieSet("auth_token","123456",600);
        return "auth filter from solon";
    }
}